Skip to main content

iRidi for Beckhoff ADS

Tools for creating a visualization interface.

The driver controls Beckhoff ADS equipment. Use the example project to get started:

Tip

Description​

iRidi for Beckhoff provides tools for creating a home or office control interface based on equipment of the same name.

Connection​

Tip

Control panels (iOS, Android, Windows, Mac) can control Beckhoff equipment only through a Beckhoff controller. Select the controller as the Target device in TwinCat System Manager.

BeckhoffConnection.png

Adding the driver manually​

To get started, add the BACnet driver from the iRidi database:

  1. Start iRidi Studio and create a new iRidi project.
  2. Open Devices in the sidebar and select Beckhoff ADS.

Beckhoff1.png

Specify the controller address in the iRidi project; otherwise, it will not work.

Configuring connection parameters​

Configure connection settings after adding the driver.

Beckhoff2.png

  • Host: Controller IP address.
  • Port: Controller connection port.
  • Keep Alive: TCP connection check interval. If a Keep Alive request receives no response, the driver is forcibly disconnected.
  • Net ID: BACnet controller identifier. Find it in the controller settings in TwinCat System Manager: SYSTEM - Configuration - CX Settings - AmsNetId.
  • Send Timeout: Beckhoff controller request send timeout in milliseconds.

NetID.png

Changing connection parameters​

You need to change connection parameters when you disconnect from the automation site's Wi-Fi network and start using 3G or another Wi-Fi network. For control to continue working, switch from the local IP address to the Internet router's public IP address.

Switching is not automatic; you need to press the connection mode selection button. For remote access, the automation system's control ports must be made public. To do this, configure Port Forwarding on the Internet router. A VPN can provide a secure connection.

  1. Download template (*.js) (right-click to save the target), then add the template to the script editor Icon_Scripts.png using (+) Add Script from file.

  2. Configure the script parameters as shown in the example:

function Internal_1() {
IR.GetDevice('Beckhoff').SetParameters({Host: "192.168.0.95", Port: 5001, TargetNetID: "5.9.57.45.1.1", "SendTimeout":20});
}
function External_1() {
IR.GetDevice('Beckhoff').SetParameters({Host: "215.110.10.10", Port: 5001, TargetNetID: "5.9.57.45.1.1", "SendTimeout":20});
}

Copy the driver name from Project Device Panel and copy the parameter list exactly from the example.

  1. Select the button that switches between Internal and External parameters. Open Macros Editor for the Press event (Object Properties > Programming), select Script Call and add it by double-clicking. Select the function the button calls:

Script_call_internal-external.png

Each button press now applies the corresponding connection settings.

Commands & Feedbacks​

SendRecieve.png

Configure Commands and Feedbacks to control equipment. To send a command, drag it onto a graphical item and specify the Value to send. To display a feedback channel value, drag the Feedback onto a graphical item and specify how to display the Value.

For more information about graphical items, see the article "Graphical item types".

Configuration​

Configure a command or feedback by setting these fields:

  • Target Port: Port for accessing the variable.

Port assignments:

NamePort
Logger100
Event Logger110
IO300
Additional Task 1301
Additional Task 2302
NC500
PLC RC 1801
PLC RC 2811
PLC RC 3821
PLC RC 4831
Canshaft Contr900
System Service10000
Scope14000
  • Type: Variable type specified in TwinCat System Manager when creating a channel or tag. iRidi supports these types:

    TypeLength, bitsDescription
    BOOL1Boolean
    BYTE8Set of 8 bits
    WORD16Set of 16 bits
    DWORD32Set of 32 bits
    LWORD64Set of 64 bits
    SINT8Signed integer
    USINT8Unsigned integer
    INT16Signed integer
    UINT16Unsigned integer
    DINT32Signed integer
    UDINT32Unsigned integer
    LINT64Signed integer
    ULINT64Unsigned integer
    REAL32Floating point
    LREAL64Floating point
    STRINGUser-defined lengthString

Find the variable type in its settings in TwinCat System Manager:

BeckhoffChannelTypes.png

  • PLC Var Name: Variable name assigned when created in TwinCat System Manager.
Tip

To access global variables in GLOBAL (including physical inputs and outputs), prefix the variable name with a dot. For example, a global TwinCat variable named SwitchButton must be specified in iRidi as .SwitchButton.

BeckhoffChannelName.png

Configuring simultaneous Beckhoff controller access from different devices​

In TwinCat System Manager, add your IP address to the allowed list: SYSTEM -> Configuration -> Route Settings -> Static Routes -> Add...

  • Route Name (Target): Any name
  • Ams Net Id: Your IP address + 1.1 (for example, 192.168.0.10.1.1)
  • Transport Type: TCP/IP
  • Address Info: Your IP address

Click Add Route, then Close.

Tip

Current Routes can also be used, but your IP address is removed from the allowed list after the controller reboots.

Tip

After loading the PLC program into the controller, reflash it so the program and all settings are restored after reboot: PLC Control -> Online -> CreateBootproject.